package immutablecollections;

import java.util.*;
/**
 * An iterator on an {@link ImListZipper}.
 * 
 */
public class ImListZipperIterator<T> implements Iterator<ImListZipper<T>>
{

    private ImListZipper<T> zipper;

    ImListZipperIterator(ImListZipper<T> zipper)
    {
        this.zipper = zipper;
    }

    public boolean hasNext()
    {
        return zipper.hasNext();
    }

    public ImListZipper<T> next()
    {
        zipper = zipper.next();
        return zipper;
    }

    public void remove()
    {
        throw new UnsupportedOperationException();
    }
}
